#include <iostream>
using namespace std;

class SalaryStrategy 
{
public:
	virtual ~SalaryStrategy() {}
	virtual void pay(int year, int month)=0;
};

class EmployeeStrategy: public SalaryStrategy 
{
public:
	void pay(int year, int month) 
	{
		cout << "pay an employee's salary for " << year << "-" << month << endl;
	}
};

class ManagerStrategy: public SalaryStrategy 
{
public:
	void pay(int year, int month) 
	{
		cout << "pay a manager's salary for " << year << "-" << month << endl;
	}
};

class ExpertStrategy: public SalaryStrategy 
{
public:
	void pay(int year, int month) 
	{
		cout << "pay an expert's salary for " << year << "-" << month << endl;
	}
};

class SalesmanStrategy: public SalaryStrategy 
{
public:
	void pay(int year, int month) 
	{
		cout << "pay a salesman's salary for " << year << "-" << month << endl;
	}
};

class Employee 
{
private:
	SalaryStrategy* strategy;
public:
	void setStrategy(SalaryStrategy* strategy) 
	{
		this->strategy = strategy;
	}
	SalaryStrategy* getStrategy() 
	{
		return this->strategy;
	}
	Employee(SalaryStrategy* strategy)
	{
		this->setStrategy(strategy);
	}
	void salary(int year, int month) 
	{
		this->strategy->pay(year, month);
	}
};

int main() 
{
	Employee* employee;
	employee = new Employee(new EmployeeStrategy());
	employee->salary(2021,1);

	employee = new Employee(new ManagerStrategy());
	employee->salary(2021,1);

	employee->setStrategy(new ExpertStrategy());
	employee->salary(2021,1);
	return 0;
}
